<template>
	<view class="category-container">
		<uv-tabs
			:list="categoryType"
			:current="currentTabCategoryType"
			@change="onTabChangeCategoryType"
			lineColor="#3c9cff"
			activeStyle="color:#3c9cff;font-weight:bold;"
			style="margin-bottom: 30rpx;"
		/>
		<view v-if="currentTabCategoryType === 0">
			<view class="mock-content">这里是全部内容的模拟展示</view>
		</view>
	</view>
</template>

<script>
	const category = {
		"categoryType": [
			{
				"category_name": "全部",
				"category_type": "all",
				"category_code": "",
				"is_selected": true
			},
			{
				"category_name": "课程",
				"category_type": "course",
				"category_code": "course",
				"is_selected": false
			},
			{
				"category_name": "话术",
				"category_type": "script",
				"category_code": "script",
				"is_selected": false
			}
		],
		"categoryFirst": [
			{
				"category_name": "全部",
				"category_type": "all",
				"category_code": "",
				"is_selected": true
			},
			{
				"category_name": "日常",
				"category_type": "script",
				"category_code": "C25030306383QE24O2RG00M5",
				"is_selected": false
			},
			{
				"category_name": "恋爱心理学",
				"category_type": "course",
				"category_code": "C2504061224B2559C9IR3Y5H",
				"is_selected": false
			},
			{
				"category_name": "恋爱思维",
				"category_type": "course",
				"category_code": "C25022122470ZW0M589Q4V0O",
				"is_selected": false
			}
		],
		"categorySecond": [
			{
				"category_name": "全部",
				"category_type": "all",
				"category_code": "",
				"is_selected": true
			},
			{
				"category_name": "观念与态度",
				"category_type": "course",
				"category_code": "C25040612269A4T47J0DYS93",
				"is_selected": false
			},
			{
				"category_name": "决策与判断",
				"category_type": "course",
				"category_code": "C2504061226R3N6ZW1Y243D4",
				"is_selected": false
			},
			{
				"category_name": "自我成长",
				"category_type": "course",
				"category_code": "C2504061226L96O8W50EM9G5",
				"is_selected": false
			},
			{
				"category_name": "心理想象",
				"category_type": "course",
				"category_code": "C2504061227X946Y87V6N6IT",
				"is_selected": false
			},
			{
				"category_name": "观念态度",
				"category_type": "course",
				"category_code": "C2502220237G710G936K3OZA",
				"is_selected": false
			},
			{
				"category_name": "决策判断",
				"category_type": "course",
				"category_code": "C250222023784V111J2PDFD1",
				"is_selected": false
			}
		]
	};

	export default {
        name: 'TmpCategoryNav',
		data() {
			return {
				categoryType: category.categoryType.map(item => ({ name: item.category_name })),
				currentTabCategoryType: 0
			}
		},
		methods: {
			onTabChangeCategoryType(e) {
				this.currentTabCategoryType = typeof e === 'object' ? e.index : e;
			}
		}
	}
</script>

<style scoped>
.category-container {
	background: #fff;
	min-height: 100vh;
	padding: 32rpx 24rpx;
}
.mock-content {
	background: #f6f7fa;
	border-radius: 16rpx;
	padding: 48rpx 0;
	text-align: center;
	color: #333;
	font-size: 32rpx;
	margin-bottom: 32rpx;
}
</style>
